package com.yisu.expressway.onedollar.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by Kaven on 2016/12/19.
 */
public class MyFragmentPagerAdapter extends FragmentPagerAdapter {
	private List<String> mTitleList;
	private List<Fragment> mFramentList;

	public MyFragmentPagerAdapter(FragmentManager fm, List<String> titles, List<Fragment> fragments) {
		super(fm);
		this.mTitleList = titles;
		this.mFramentList = fragments;
	}

	@Override
	public Fragment getItem(int position) {
		return mFramentList.get(position);
	}

	@Override
	public int getCount() {
		return mTitleList.size();
	}

	@Override
	public CharSequence getPageTitle(int position) {
		return mTitleList.get(position);
	}
}